import Vue from 'vue';
import VueRouter from 'vue-router';

Vue.use(VueRouter);
/*
meta: { title, doNotSetTitle }   doNotSetTitle: true 为 不设置title为当前页面的 document.title  否则只要设置了meta.title  就会被设置为document.title
*/
const routes = [
  // {
  //   path: '/',
  //   name: 'Tabbar', // Tabbar layouts 在这个路由的children下 共享 tabbar
  //   component: () => import('../views/layouts/tabbar'),
  //   redirect: '/home',
  //   children: [
  //     {
  //       // 小屋 首页
  //       path: 'home',
  //       name: 'Home',
  //       meta: { title: '首页' },
  //       /* Route lazy loading。 由 webpackChunkName 把此页面组件打包成home的名称 在调用的时候再装载 下面的同理 */

  //       component: () => import(/* webpackChunkName: "home" */ '../views/home/index')
  //     },
  //   ]
  // },
  {
    path: '/',
    name: 'Empty', // 空容器 在此路由的children下 会得到一个完整的可开发页面
    component: () => import('../views/layouts/page.vue'),
    children: [
      {
        path: '',
        name: 'Index',
        meta: { title: '重庆依法治市智慧云平台' },
        component: () => import('../views/index')
      },
      {
        path: 'list',
        name: 'List',
        meta: { title: '' },
        component: () => import('../views/list')
      },
      {
        path: 'child1',
        name: 'Child1',
        meta: { title: '' },
        component: () => import('../views/child1')
      },
      {
        path: 'child2',
        name: 'Child2',
        meta: { title: '' },
        component: () => import('../views/child2')
      },
      {
        path: 'child3',
        name: 'Child3',
        meta: { title: '' },
        component: () => import('../views/child3')
      },
      {
        path: 'pageview',
        name: 'Pageview',
        meta: { title: '' },
        component: () => import('../views/pageview')
      },
      {
        path: 'pdfswiper',
        name: 'Pdfswiper',
        meta: { title: '' },
        component: () => import('../views/pdfswiper')
      },
      {
        path: 'newsDetail',
        name: 'NewsDetail',
        meta: { title: '' },
        component: () => import('../views/newsDetail')
      },
    ]
  }
];

const router = new VueRouter({
  routes
});

export default router;
